package cn.javass.framework.web.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.javass.framework.web.core.ActionContext;
import cn.javass.framework.web.wrapper.ApplicationMap;
import cn.javass.framework.web.wrapper.SessionMap;

public class ContextUtils {
	public static ActionContext populate(HttpServletRequest request ,HttpServletResponse response){
		ActionContext context = ActionContext.getContext();
		SessionMap sessionMap = new SessionMap(request);
		ApplicationMap applicationMap = new ApplicationMap(request.getSession().getServletContext());
		context.setApplication(applicationMap);
		context.setSession(sessionMap);
		return context;
	}
}
